import WsClientPool from '../modules/WsClientPool';

function middleware(_app) {
    const app = _app;

    const clientPool = new WsClientPool(app);

    app.clientPool = clientPool;
    app.getClient = clientPool.get.bind(clientPool);

    return function* dispatch(next) {
        yield next;
    };
}

export default middleware;
